<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../common/header.jsp"%>
<div id="content" class="col-lg-10 col-sm-10">
	<div>
		<ul class="breadcrumb">
			<li><a href="#">基本信息</a></li>
			<li><a href="#">仓库管理</a></li>
		</ul>
	</div>

	<div class=" row">
			<div class="box col-md-12">
				<div class="box-inner">
					<div class="box-header well" data-original-title="">
						<h2>
							<i class="fa fa-home"></i> 仓库信息管理
						</h2>

						<div class="box-icon">
							<a title="新增仓库" 
								data-toggle="tooltip" > <i
								class="glyphicon glyphicon-plus repoadd"></i></a>
						</div>
					</div>
					<div class="box-content">
						<div class="alert alert-info">
							角色:${operator.roleName},您可以对仓库信息进行管理<br>
							注:在本系统中【剩余空间】和【最大空间】的单位代表物资存放件数
						</div>
						</br>
						<a class="btn btn-success repoadd">新增仓库</a>
						<table class="table table-striped table-bordered responsive">
							<thead>
								<tr>
									<th>仓库编号</th>
									<th>仓库代号</th>
									<th>仓库经理</th>
									<th>创建时间</th>
									<th>剩余空间(件)</th>
									<th>最大空间(件)</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${repolist}" var="repo">
									<tr>

										<td class="center">${repo.repoCode}</td>
										<td class="center">${repo.repoName}</td>
										<td class="center">${repo.manager}</td>
										<td class="center">
										<fmt:formatDate value="${repo.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
										<td class="center">${repo.leftSpace == null ? repo.maxSpace : repo.leftSpace}</td>
										<td class="center">${repo.maxSpace}</td>
										<td class="center"><a class="btn btn-primary repoedit"
											repo-code="${repo.repoCode}"
											url="${pageContext.request.contextPath}/">
												<i class="glyphicon glyphicon-edit icon-white"></i> 修改
										</a> 
										<a class="btn btn-warning repoclear"
											repo-code="${repo.repoCode}"
											url="${pageContext.request.contextPath}/">
												<i class="glyphicon glyphicon-refresh icon-white"></i> 清仓
										</a>
										<a class="btn btn-danger repodel"
											url="${pageContext.request.contextPath}/"
										    repo-code="${repo.repoCode}"> <i
												class="glyphicon glyphicon-trash icon-white"></i> 移除
										</a></td>

									</tr>
								</c:forEach>
							</tbody>
						</table>

						

					</div>
				</div>
			</div>
			<!--/span-->
</div>
</div>

<div class="modal fade" id="modifyRepo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
      	
      		 
	        <div class="modal-dialog">
	            <div class="modal-content">
	            	<form id="repoForm" action="${pageContext.request.contextPath}/basic/repo/savemodify" method="POST">
	                <div class="modal-header">
	                    <button type="button" class="close" data-dismiss="modal">×</button>
	                    <h3>修改仓库信息</h3>
	                </div>
	                <div class="modal-body">
	                   	<ul id="modify-errtip" class="alert alert-info"></ul>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                				<span >仓库编号:</span>
                  				<input type="text" readonly="readonly" id="m_repoCode" name="repoCode" class="form-control"/>
                  		</div>	
                  		
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>仓库代号:</span>
                  				<input type="text" id="m_repoName" name="repoName" class="form-control" required="required"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >仓库经理</span>
                  				<input type="text" id="m_manager" name="manager" class="form-control"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >剩余空间:</span>
                  				<input type="text" id="m_leftSpace" name=leftSpace class="form-control" readonly="readonly"/>
                  				
                  		</div>  
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >最大空间:</span>
                  				<input type="text" id="m_maxSpace" name="maxSpace" class="form-control" required="required"/>
                  				
                  		</div>    
                  			
           
	                  	<div class="clearfix"></div>
	                </div>
	                <div class="modal-footer">
	                    <a href="#" class="btn btn-default" data-dismiss="modal">关闭</a>
	              		<button type="submit" class="btn btn-primary">保存修改</button>
	                   <!-- <a href="#" id="modifyBtn" class="btn btn-primary" data-dismiss="modal">保存修改</a> -->
	                </div>
	                 </form>
	            </div>
	        </div>
       
</div>

<!-- 新增模态框 -->
<div class="modal fade" id="addRepo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true"  data-backdrop="static">
      	
      		 
	        <div class="modal-dialog">
	            <div class="modal-content">
	            	<form id="repoAddForm" action="${pageContext.request.contextPath}/basic/repo/saveadd" method="POST">
	                <div class="modal-header">
	                    <button type="button" class="close" data-dismiss="modal">×</button>
	                    <h3>新增仓库信息</h3>
	                </div>
	                <div class="modal-body">
	                   	<ul id="add-errtip" class="alert alert-info" style="display:none;"></ul>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                				<span >仓库编号:</span>
                  				<input type="text" required="required" id="a_repoCode" name="repoCode" class="form-control"/>
                  		</div>	
                  		
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                			   <button class="btn btn-success autoCode">自动生成</button>
                  		</div>	
                  		
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>仓库代号:</span>
                  				<input type="text"  name="repoName" class="form-control" required="required"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >仓库经理:</span>
                  				<input type="text"  name="manager" class="form-control" required="required"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >最大空间:</span>
                  				<input type="text" name="maxSpace" class="form-control" required="required"/>
                  				
                  		</div>    
                  			
           
	                  	<div class="clearfix"></div>
	                </div>
	                <div class="modal-footer">
	                    <a href="#" class="btn btn-default" data-dismiss="modal">取消</a>
	              		<button type="submit" class="btn btn-primary">添加</button>

	                </div>
	                 </form>
	            </div>
	        </div>
       
    </div>

<!-- 修改的模态框 -->
 <div class="modal fade" id="modifyRepo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true"  data-backdrop="static">
      	
      		 
	        <div class="modal-dialog">
	            <div class="modal-content">
	            	<form id="repoForm" action="${pageContext.request.contextPath}/basic/repo/savemodify" method="POST">
	                <div class="modal-header">
	                    <button type="button" class="close" data-dismiss="modal">×</button>
	                    <h3>修改仓库信息</h3>
	                </div>
	                <div class="modal-body">
	                   	<ul id="modify-errtip" class="alert alert-info" style="display: none;"></ul>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                				<span >仓库编号:</span>
                  				<input type="text" readonly="readonly" id="m_repoCode" name="repoCode" class="form-control"/>
                  		</div>	
                  		
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span>仓库代号:</span>
                  				<input type="text" id="m_repoName" name="repoName" class="form-control" required="required"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >仓库经理</span>
                  				<input type="text" id="m_manager" name="manager" class="form-control"/>
                  				
                  		</div>
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >剩余空间:</span>
                  				<input type="text" id="m_leftSpace" name=leftSpace class="form-control" readonly="readonly"/>
                  				
                  		</div>  
                  		<div class="form-group col-md-6 col-sm-6 col-xs-12">
                  				<span >最大空间:</span>
                  				<input type="text" id="m_maxSpace" name="maxSpace" class="form-control" required="required"/>
                  				
                  		</div>    
                  			
           
	                  	<div class="clearfix"></div>
	                </div>
	                <div class="modal-footer">
	                    <a href="#" class="btn btn-default" data-dismiss="modal">关闭</a>
	              		<button type="submit" class="btn btn-primary">保存修改</button>
	                   <!-- <a href="#" id="modifyBtn" class="btn btn-primary" data-dismiss="modal">保存修改</a> -->
	                </div>
	                 </form>
	            </div>
	        </div>
       
    </div>

<!-- 清仓模态框 -->
<div class="modal fade" id="clearRepo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">

        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                	<input id="c_repoCode" name="repoCode" type="hidden"/>
                    <button type="button" class="close" data-dismiss="modal">×</button>
                    <h3>清仓提示</h3>
                </div>
                <div class="modal-body">
                    <p id="clearInfo"></p>
                </div>
                <div class="modal-footer">
                    <a href="#" class="btn btn-default" data-dismiss="modal">取消</a>
                    <a href="#"
                     class="btn btn-warning" id="clearBtn" data-dismiss="modal">确定</a>
                </div>
            </div>
        </div>
    </div>
<!-- 删除模态框 -->
  <div class="modal fade" id="delRepo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">

        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                	<input id="d_repoCode" name="repoCode" type="hidden"/>
                    <button type="button" class="close" data-dismiss="modal">×</button>
                    <h3>温馨提示</h3>
                </div>
                <div class="modal-body">
                    <p id="delInfo"></p>
                </div>
                <div class="modal-footer">
                    <a href="#" class="btn btn-primary" data-dismiss="modal">否</a>
                    <a href="#"
                     class="btn btn-default" id="delBtn" data-dismiss="modal">是</a>
                </div>
            </div>
        </div>
    </div>

<button class="btn btn-primary cleartip noty" data-noty-options style="display:none;"></button>
<button class="btn btn-primary deltip noty" data-noty-options style="display:none;"></button>
<%@ include file="../common/footer.jsp"%>
<script src="${pageContext.request.contextPath}/statics/local/js/repo.js"></script>




